/* 
 * File:   FileWindow.h
 * Author: mauro
 *
 * Created on 13 de octubre de 2014, 16:51
 */

#ifndef FILEWINDOW_H
#define	FILEWINDOW_H

#include <stdio.h>
#include <iostream>
#include <cstdlib>
#include <JSON/json.hh>
#include <string>
#include <vector>
#include <cmath>
#include <Box2D/Box2D.h>
#include "FileCharacter.h"
#include "FileObjects.h"

using namespace std;

class FileWindow {
    
private:
    
    const char* fileName;
    string name;
    string backGround;
    float gravity;
    int pixelHeight;
    int pixelWidth;
    int logicalUnitH;
    int logicalUnitW;
    int objectsNumber;
    int maxPlayers;
    
    vector <FileCharacter> players;
    vector <FileObjects> objects;
    
    vector <FileObjects> *polygonSix;
    vector <FileObjects> *polygonThree;
    vector <FileObjects> *polygonFive;
    vector <FileObjects> *circle;
    vector <FileObjects> *rectangle;
    vector <FileObjects> *endObject;
    vector <FileObjects> *parrallellogram;
    vector <FileObjects> *trapezium;
    
    
    

public:
    
    FileWindow(const char* fileName);
    FileWindow(bool loadall);
    void loadWindow();
    void loadDefaultWindow(bool dn, bool dg, bool db, bool dph, bool dpw, bool dluh, bool dluw, bool dplay, bool dobj);
    bool reloadWindow();
    string getName();
    string getBackGround();
    float getGravity();
    int getPixelHeight();
    int getPixelWidth();
    int getLogicalUnitHeight();
    int getLogicalUnitWidth();
    int getObjectsNumber();
    int getPlayerXLocation(int idPlayer);
    int getPlayerYLocation(int idPlayer);
    int getMaxPlayers ();
    
    vector <FileObjects> getObjects();
    vector <FileCharacter> getPlayers();
    void creatDefaultObjects();
    void creatDefaultCharacters();
    
    void filterOverlap();
    
    vector<FileObjects>* getEndObject();
    vector<FileObjects>* getParrallellogram();
    vector<FileObjects>* getRectangle();        
    vector<FileObjects>* getCircle();        
    vector<FileObjects>* getPolygon(int sides);  
    vector<FileObjects>* getTrapezium();


    
    virtual ~FileWindow();    
};

#endif	/* FILEWINDOW_H */